{* $Id: paypal_trans.tpl,v 1.1.2.1 2007/02/27 08:05:57 max Exp $ *}
{if $data && $data.main}
<br />
<a name="paypal"></a>
{capture name=dialog}

{if $data.method eq 'US'}
{$lng.txt_paypal_section_note_us}
{else}
{$lng.txt_paypal_section_note_uk}
{/if}
<br />

<br />
{include file="main/subheader.tpl" title=$lng.lbl_paypal_orig_transaction class="grey"}

{if !$data.main.update_date && $data.method eq 'US'}
<b>{$lng.lbl_note}:</b> {$lng.txt_paypal_main_trans_no_updated}<br />
<br />
{/if}

<table cellspacing="1" cellpadding="2">
<tr>
	<td>{$lng.lbl_paypal_pmethod}:</td>
	<td>{if $data.method eq 'US'}PayPal Website Payments Pro{else}PayPal Website Payments Pro PayFlow Edition{/if}</td>
</tr>
<tr>
	<td>{$lng.lbl_paypal_used_api}:</td>
	<td>{if $data.api eq 'EC'}Express Checkout{else}Direct Payment{/if}</td>
</tr>
<tr>
	<td>{$lng.lbl_paypal_txnid}:</td>
	<td>{$data.main.txnid}</td>
</tr>
{if $data.method eq 'US'}
<tr>
	<td>{$lng.lbl_paypal_txn_type}:</td>
	<td>{$data.main.txn_type|default:$lng.txt_not_available}</td>
</tr>
<tr>
    <td>{$lng.lbl_paypal_payer_id}:</td>
    <td>{$data.main.payer_id|default:$lng.txt_not_available}</td>
</tr>
<tr>
    <td>{$lng.lbl_paypal_payer_status}:</td>
    <td>{$data.main.payer_status|default:$lng.txt_not_available}</td>
</tr>
<tr>
    <td>{$lng.lbl_paypal_payer_email}:</td>
    <td>{$data.main.payer_email|default:$lng.txt_not_available}</td>
</tr>
<tr>
    <td>{$lng.lbl_paypal_receiver_id}:</td>
    <td>{$data.main.receiver_id|default:$lng.txt_not_available}</td>
</tr>
<tr>
    <td>{$lng.lbl_amount}:</td>
    <td>{if $data.main.amount}{$data.main.amount|formatprice} {$data.main.currencycode|default:"USD"}{else}{$lng.txt_not_available}{/if}</td>
</tr>
<tr>
	<td>{$lng.lbl_paypal_update_date}:</td>
	<td>{if $data.main.update_date}{$data.main.update_date|date_format:$config.Appearance.datetime_format}{else}{$lng.txt_not_available}{/if}</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="button" value="{$lng.lbl_update|escape}" onclick="javascript: self.location = 'order.php?orderid={$orderid}&mode=update_paypal';" /></td>
</tr>
{/if}
</table>

<br />
{include file="main/subheader.tpl" title=$lng.lbl_paypal_refund_transactions class="grey"}
<table cellspacing="1" cellpadding="2" width="100%">
<tr class="TableHead" style="white-space: nowrap;">
	<th>{$lng.lbl_paypal_txnid}</th>
	<th>{$lng.lbl_amount}</th>
	<th>{$lng.lbl_date}</th>
	<th width="100%">{$lng.lbl_note}</th>
</tr>
{foreach from=$data.refunds item=r key=rid}
<tr{cycle values=', class="TableSubHead"' name="paypal_refunds"}>
	<td>{$rid}</td>
	<td align="right" nowrap="nowrap">{$r.amount|formatprice} {$r.currencycode}</td>
	<td align="center" nowrap="nowrap">{$r.date|date_format:$config.Appearance.datetime_format}</td>
	<td>{$r.note}</td>
</tr>
{foreachelse}
<tr>
	<td colspan="4" align="center">{$lng.lbl_paypal_refunds_list_is_empty}</td>
</tr>
{/foreach}
</table>

{if $data.no_refund_total > 0}

<br />
{include file="main/subheader.tpl" title=$lng.lbl_paypal_create_refund class="grey"}
{$lng.txt_paypal_section_note_refund}<br />
<form action="order.php" method="post" name="paypalrefundform">
<input type="hidden" name="orderid" value="{$orderid}" />
<input type="hidden" name="mode" value="create_refund" />

<table cellspacing="1" cellpadding="2">

{if $data.method eq 'US'}
<tr>
	<td>{$lng.lbl_amount}:</td>
	<td><input type="text" name="amount" value="{$data.no_refund_total}" /></td>
</tr>
{/if}

<tr>
	<td>{$lng.lbl_note}:</td>
	<td><textarea name="note" cols="30" rows="4"></textarea></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" value="{$lng.lbl_create|escape}" /></td>
</tr>

</table>

</form>
{/if}

{/capture}
{include file="dialog.tpl" title=$lng.lbl_paypal_transactions content=$smarty.capture.dialog extra='width="100%"'}

{/if}
